<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml"
      xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <title>旧机入库</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="/dist/plugins/bootstrap/css/bootstrap.min.css">
    <!--字体-->
    <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
    <!--插件样式-->
    <link rel="stylesheet" href="/dist/plugins/select2/select2.min.css">
    <link href="/dist/plugins/ztree/css/zTreeStyle/zTreeStyle.css" rel="stylesheet"/>
    <link rel="stylesheet" href="/dist/plugins/webuploader-0.1.5/webuploader.css">
    <!--图标-->
    <link rel="stylesheet" href="/dist/css/ionicons.min.css">
    <!--OA主样式-->
    <link rel="stylesheet" href="/dist/css/OA.min.css?t=e9c5bb62">
    <link rel="stylesheet" href="/dist/css/skins/OA-skins.min.css?t=66b457d6">
    <style>
        td.td-value2 {
            padding: 1px !important;
            text-align: left !important;
        }

        .td-value2 input {
            box-shadow: inset 1px 1px 4px #333;
            height: 100% !important;
            padding-left: 4px !important;
        }

        .td-value2 select {
            box-shadow: inset 1px 1px 4px #333;
            height: 100% !important;
            padding-left: 4px !important;
        }

        .select {
            padding-left: 2px;
        }

        .IcoNormal {
            float: left;
            border-bottom: 0px;
            border-left: 0px;
            background-color: transparent;
            width: 16px;
            height: 16px;
            vertical-align: middle;
            border-top: 0px;
            border-right: 0px;
            background-image: url(/dist/img/upload_normal.gif);
            background-repeat: no-repeat;
            float: left;
        }

        td.td-title, td select, td .filename, td.td-module {
            color: #333;
        }
        
        td.td-value2,td span {
            position: relative;
            color: #2a8cec;
        }

        .table .td-value span {
            line-height: 22px;
        }

        .delfile:hover {
            color: red;
        }

        .progressobj .delfile {
            float: left;
            margin-left: 10px;
        }

        .noFujian {
            /*background: url(/dist/img/fujian2.png) no-repeat 20px center;*/
            /*color: #ddd;*/
            cursor: no-drop;
            display: none;
        }

        table input {
            border: none;
            width: 100%;
        }

        .div-td-content-more {
            position: absolute;
            height: auto;
            z-index: 999;
            line-height: 20px;
            background-color: #d3e8fd;
            padding: 8px 6px;
            border: 1px solid #e8e8ea;
            display: none;
        }

        .div-td-content-more i {
            width: 15px;
            height: 12px;
            background: url("/dist/img/more-icon.png");
            position: absolute;
            left: 50px;
            top: -12px;
        }

        .lineOne {
            text-align: left;
        }

        .lineOne span {
            max-height: 20px;
            line-height: 20px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
            text-align: left;
        }

        input[type=text], input[type=tel], input[type=number], select {
            box-sizing: border-box;
            border-width: 0px;
            border-style: none;
            padding-right: 0px !important;
            padding-top: 0px !important;
            padding-bottom: 0px !important;
            margin-left: 0px !important;
            margin-right: 0px !important;
            margin-top: 0px !important;
            margin-bottom: 0px !important;
            padding-left: 6px;
        }

        input[type=text], input[type=tel], input[type=number], select {
            height: 24px;
            width: 100%;
            border: none;
            outline: none;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .lineOne {
            text-align: left;
        }

        .lineOne span {
            max-height: 20px;
            line-height: 20px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
            text-align: left;
        }

        .biTian {
            /*position: absolute;
            left: 30px;
            top: 6px;
            color: red;*/
            position: absolute;
            color: #000;
            margin-left: -15px;
            margin-top: 2px;
        }
        .webuploader-pick {
            background: url(/dist/img/fjT1.png) no-repeat 5px center;
            display: block;
            padding: 0 4px;
            height: 22px;
            line-height: 22px;
            padding-left: 15px;
            margin: 0 auto;
            width: 70px;
            margin-top: 6px;
            border-radius: 4px;
        }
        .webuploader-pick-hover{
            color: #fff!important;
            background: url(/dist/img/fjT2.png) no-repeat 5px center;
            background-color: #0F6099;

        }
        #divUploadedFiles{
            /*padding: 4px;*/
            padding-bottom: 0;
        }
        /*.webuploader-pick {
            position: relative;
            display: block;
            vertical-align: middle;
            cursor: pointer;
            background: url(/dist/img/fujianShu.png) no-repeat left center;
            background: #fff;
            box-shadow: 1px 1px 4px #333;
            color: #333;
            padding: 3px 6px;
            height: 100%;
        }*/
        .title{
            background-color: #d3e8fd;
            color:black;
        }
        .jiaobiao3 {
            position: relative;
        }

        .jiaobiao3 i {
            display: block;
            width: 10px;
            height: 10px;
            background: url("/dist/img/newLog3.png");
            position: absolute;
            top: 0px;
            right: 0px;
        }
        .moreListData{
            position: absolute;
            top: 30px;
            z-index: 111;
            display:none;
        }
        .moreListData .item{
            width: 100%;
            height: 30px;
            line-height: 30px;
        }
        .moreListData .item span{
            margin-right: 5px;
        }
        .ui_main{
            vertical-align: top;
        }
        .table-detail textarea {
            height: 60px;
            width: 100%;
            border: none;
            outline: none;
            -webkit-appearance: none;
            resize: none;
            line-height: 20px;
            padding-top: 2px !important;
            padding-left: 6px;
        }
    </style>
</head>
<body>
<iframe id="ifAttach" style="display:none"></iframe>
<ul class="ztree" id="ulZTree"
    style="z-index:999;display:none;position:absolute;background-color:white;border:1px solid #72C3D9;height:200px;margin-top:0px;margin-left:0px;padding-left:0px;padding-top:5px;padding-bottom:5px;padding-right:0px;margin-right:0px;margin-bottom:0px;overflow: auto;"></ul>
<section class="content" id="app" v-cloak=>
    <div class="div-td-content-more"><i></i></div>
    <div id="div" style="margin-top: 12px">
        <div style="float: left;width: 100%">
            <div class="center" style="overflow: auto;margin-left: -10px;margin-top:-20px"
                 id="scrollDiv">
                <div id="progress" class="wyui-progress"></div>
                <!--汽车信息-->
                <table class="table table-detail table-bordered text-center" id="oldSample">
                    <tr class="no-print">
                        <td colspan="4" class=" no-print  title">公司人员信息</td>
                    </tr>

                    <tr style="height:30px;">
                        <td style="color:black;background-color:#F8F8F8;width: 25%"><i class="biTian">*</i>归属公司</td>
                        <td style="width: 25%" class="td-value2">
                            <select class=" td-row2 td-value " id="testCom" v-model="displace.companyName"
                                    style=" padding-left: 2px;" @change="getCompanyId(displace.companyName,itemsCom)"
                                    v-if="showInput('0')">
                                <option value=""></option>
                                <option v-for="itemC in itemsCom" v-bind:value="itemC.name"> {{itemC.name}}</option>
                            </select>
                            <span v-else>{{displace.companyName}}</span>
                        </td>
                        <td style="color:black;background-color:#F8F8F8">区域经理</td>
                        <td class="td-value2 moreList" data-table="t_dvc_displace" data-column="regionManagerName"
                            data-type='1'>
                            <input class="td-value" placeholder="请输入区域经理名称" type="text" id="regionManagerName"
                                   v-model="displace.regionManagerName"  v-if="showInput('区域经理')"
                                   v-on:click.stop="inputFocus('regionManagerName')"/>
                            <span v-else>{{displace.regionManagerName}}</span>
                        </td>
                    </tr>
                    <tr style="height:30px">
                        <td style="color:black;background-color:#F8F8F8">大区经理</td>
                        <td class="td-value2 moreList" data-table="t_dvc_displace" data-column="bigregionManagerName"
                            data-type='1'>
                            <input class="td-value" type="text" v-model="displace.bigregionManagerName" v-if="">
                            <span v-else>{{displace.bigregionManagerName}}</span>
                        </td>
                        <td style="color:black;background-color:#F8F8F8;width: 25%">区域</td>
                        <td style="width: 25%;" class="td-value2 moreList" data-table="t_dvc_displace"
                            data-column="regionName" data-type='1'>
                            <input class="td-value" type="text" v-model="displace.regionName" v-if="">
                            <span v-else>{{displace.regionName}}</span>
                        </td>
                    </tr>
                    <!--置换新机信息 -->
                    <tr class="no-print">
                        <td colspan="4" class=" no-print  title">置换新机信息</td>
                    </tr>
                    <tr style="height:30px;">
                        <td style="color:black;background-color:#F8F8F8;width: 25%">客户</td>
                        <td class="td-value2">
                            <input type="text" v-if="showInput('置换客户')" v-model="displace.customerName">
                            <span v-else>{{displace.customerName}}</span>
                        </td>
                        <td style="color:black;background-color:#F8F8F8;width: 25%">品牌</td>
                        <td class="td-value2">
                            <input type="text" v-if="showInput('置换品牌')" v-model="displace.replacementDeviceBrandName">
                            <span v-else>{{displace.replacementDeviceBrandName}}</span>
                        </td>
                    </tr>
                    <tr style="height:30px">
                        <td style="color:black;background-color:#F8F8F8">机型</td>
                        <td class="td-value2">
                            <input type="text" v-if="showInput('置换机型')" v-model="displace.replacementDeviceModelName">
                            <span v-else>{{displace.replacementDeviceModelName}}</span>
                        </td>
                        <td style="color:black;background-color:#F8F8F8">序列号</td>
                        <td class="td-value2">
                            <input type="text" v-if="showInput('置换序列号')" v-model="displace.replacementDeviceSequence">
                            <span v-else>{{displace.replacementDeviceSequence}}</span>
                        </td>
                    </tr>
                    <tr class="no-print">
                        <td colspan="4" class=" no-print title">设备信息</td>
                    </tr>
                    <tr class="td-row2 td-value" style="height:30px">
                        <td style="color:black;background-color:#F8F8F8"><i class="biTian">*</i>品牌</td>
                        <td class="td-value2">
                            <input type="text" v-model="displace.brandName" v-if="showInput('0')">
                            <span v-else style="margin-left:10px">{{displace.brandName}}</span>
                        </td>
                        <td style="color:black;background-color:#F8F8F8"><i class="biTian">*</i>汽车类型</td>
                        <td class="td-value2">
                           <!-- <select class=" td-row2 td-value" id="testRep" v-model="displace.replacementType"
                                    style=" padding-left: 2px;"
                                    v-if="showInput('0')">
                                <option>轿车</option>
                                <option>SUV</option>
                                <option>客车</option>
                                <option>房车</option>
                                <option>跑车</option>
                                <option>半挂车</option>
                                <option>载货汽车</option>
                                <option>越野汽车</option>
                            </select>-->
                            <input type="text" v-model="displace.replacementType" v-if="showInput('0')" id="testRep" >
                            <span v-else style="margin-left:10px">{{displace.replacementType}}</span>
                        </td>
                    </tr>
                    <tr class="td-row2 td-value" style="height:30px">
                        <td style="color:black;background-color:#F8F8F8"><i class="biTian">*</i>型号</td>
                        <td class="td-value2">
                            <input type="text" v-model="displace.modelName" v-if="showInput('0')">
                            <span v-else style="margin-left:10px">{{displace.modelName}}</span>
                        </td>
                        <td style="color:black;background-color:#F8F8F8"><i class="biTian">*</i>车架号</td>
                        <td class="td-value2">
                            <input type="text" v-model="displace.sequence" v-if="showInput('0')">
                            <span v-else style="margin-left:10px">{{displace.sequence}}</span>
                        </td>
                    </tr>
                    <tr class="td-row2 td-value" style="height:30px">
                        <td style="color:black;background-color:#F8F8F8">出厂年份</td>
                        <td class="td-value2">
                            <input type="text" v-model="displace.factoryDate" v-if="showInput('0')"
                                   @focus="showDatePickerYear($event)">
                            <span v-else style="margin-left:10px">{{displace.factoryDate}}</span>
                        </td>
                        <td style="color:black;background-color:#F8F8F8">公里数(公里)</td>
                        <td class="td-value2">
                            <input v-if="showInput('公里数')" style="width: 100%;border: 0px" type="text"
                                   @blur="strFormat($event.target,'displace.kilometers')"
                                   @focus="strFormatF($event.target,'displace.kilometers')"
                                   v-onedate="fmoney(displace.kilometers)">
                            <span v-else style="margin-left:10px">{{displace.kilometers}}</span>
                            <!--<span style="position:absolute;left:170px;top: 3px;">公里</span>-->
                        </td>
                    </tr>
                    <tr  style="height:30px">
                        <td style="color:black;background-color:#F8F8F8">库存地</td>
                        <td class="td-value2">
                            <select class=" td-row2 td-value" id="storeAddress" v-model="displace.storeAddress"
                                    style=" padding-left: 2px;"
                                    v-if="showInput('0')">
                                <option value=""></option>
                                <option v-for="itemS in stocks" :value="itemS.stockArea">{{itemS.stockArea}}</option>
                            </select>
                            <span v-else-if="pageType=='edit'&&displace.destination!=''&&displace.state=='库存'&&moveBound.main.type!=1" style="margin-left:10px">{{displace.destination}}</span>
                            <span v-else-if="pageType=='edit'&&displace.state=='库存'&&moveBound.main.type==1" style="margin-left:10px">{{moveBound.main.delivery_address}}</span>
                            <span v-else style="margin-left:10px">{{displace.storeAddress}}</span>
                        </td>
                        <td style="color:black;background-color:#F8F8F8"><i class="biTian">*</i>状态</td>
                        <td class="td-value2 moreList" data-table="t_dvc_displace" data-column="state" data-type='1'>
                            <select class=" td-row2 td-value" v-model="displace.state"
                                    v-if="showInput('状态')"
                                    style=" padding-left: 2px;">
                                <option></option>
                                <option v-if="pageType=='edit'||displace.state=='提车在途'||displace.state=='库存'||displace.state==''">
                                    提车在途
                                </option>
                                <option v-if="pageType=='edit'||displace.state=='提车在途'||displace.state=='交付在途'||displace.state=='移库在途'||displace.state=='退货在途'||displace.state=='库存'||displace.state==''">
                                    库存
                                </option>
                                <option v-if="isAdd!=1&&(displace.state=='交付在途'||displace.state=='已交')">交付在途</option>
                                <option v-if="isAdd!=1&&( displace.state=='交付在途'||displace.state=='已交' )">已交</option>
                                <option v-if="isAdd!=1&&displace.state=='移库在途'">移库在途</option>
                                <option v-if="isAdd!=1&&(displace.state=='退货在途'||displace.state=='已退货')">退货在途</option>
                                <option v-if="isAdd!=1&&(displace.state=='已退货'||displace.state=='退货在途')">已退货</option>
                            </select>
                            <span v-else style="margin-left:10px">{{displace.state}}</span>
                        </td>
                    </tr>
                    <tr  style="height:30px">
                        <td style="color:black;background-color:#F8F8F8">是否过户</td>
                        <td class="td-value2 moreList" data-table="t_dvc_displace" data-column="transfer" data-type='1'>
                            <select    v-if="showInput('是否过户')" v-model="displace.transfer"
                                    style="color: #2a8cec !important;padding-left: 2px;">
                                <option v-for="option in transferList" v-bind:value="option.value">
                                    {{option.text}}
                                </option>
                            </select>
                            <span v-else style="margin-left:10px">{{displace.transfer}}</span>
                        </td>

                        <td style="color:black;background-color:#F8F8F8">保险到期日</td>
                        <td class="td-value2 moreList" data-table="t_dvc_displace" data-column="insuranceExpirationDate" data-type='1'>
                            <input type="text" v-model="displace.insuranceExpirationDate" v-if="showInput('保险到期日')"
                                   style="font-weight:normal" @focus="showDatePicker($event)">
                            <span v-else style="margin-left:10px">{{displace.insuranceExpirationDate}}</span>
                        </td>
                    </tr>
                    <tr  style="height:30px">
                        <td style="color:black;background-color:#F8F8F8">评估价格(元)</td>
                        <td class="td-value2 moreList" data-table="t_dvc_displace" data-column="estimatePrice" data-type='1'>
                            <input v-if="showInput('评估价格')" style="width: 100%;border: 0px" type="text"
                                   @blur="strFormat($event.target,'displace.estimatePrice')"
                                   @focus="strFormatF($event.target,'displace.estimatePrice')"
                                   v-onedate="fmoney(displace.estimatePrice)"/>
                            <span v-else class="pull-left "
                                  style="margin-left:10px">{{fmoney(displace.estimatePrice)}}</span>
                           <!-- <span style="position:absolute;left:170px;top: 3px;">元</span>-->
                        </td>
                        <td style="color:black;background-color:#F8F8F8">置换价格(元)</td>
                        <td class="td-value2 moreList" data-table="t_dvc_displace" data-column="replacementPrice" data-type='1'>
                            <input v-if="showInput('置换价格')" style="width: 100%;border: 0px" type="text"
                                   @blur="strFormat($event.target,'displace.replacementPrice')"
                                   @focus="strFormatF($event.target,'displace.replacementPrice')"
                                   v-onedate="fmoney(displace.replacementPrice)"/>
                            <span v-else class="pull-left " style="margin-left:10px">{{fmoney(displace.replacementPrice)}}</span>
                           <!-- <span style="position:absolute;left:170px;top: 3px;">元</span>-->
                        </td>
                    </tr>

                    <tr  style="height:30px">
                        <td style="color:black;background-color:#F8F8F8" >出售价格(元)</td>
                        <td class="td-value2 moreList"  data-table="t_dvc_displace" data-column="sellPrice" data-type='1'>
                            <input v-if="showInput('出售价格')" style="width: 100%;border: 0px" type="text"
                                   @blur="strFormat($event.target,'displace.sellPrice'),loss(displace.sellPrice)"
                                   @focus="strFormatF($event.target,'displace.sellPrice')"
                                   v-onedate="fmoney(displace.sellPrice)"/>
                            <span v-else class="pull-left "
                                  style="margin-left:10px">{{fmoney(displace.sellPrice)!=0?displace.sellPrice:"未出售"}}</span>
                            <!--<span style="position:absolute;left:170px;top: 3px;">元</span>-->
                        </td>
                        <td style="color:black;background-color:#F8F8F8">亏损(元)</td>
                        <td class="td-value2 moreList" data-table="t_dvc_displace" data-column="lossMoney"
                            data-type='1'>
                            <span  class="pull-left"
                                   style="margin-left:0px;">{{fmoney(displace.sellPrice)!=0?displace.lossMoney:"未出售"}}</span>
                        </td>
                        <!--<td style="color:black;background-color:#F8F8F8">置换补贴</td>
                        <td colspan="3" class="td-value2">
                            <input v-if="showInput('0')" style="width: 100%;border: 0px" type="text"
                                   @blur="strFormat($event.target,'displace.replacementSubsidy')"
                                   @focus="strFormatF($event.target,'displace.replacementSubsidy')"
                                   v-onedate="fmoney(displace.replacementSubsidy)"/>
                            <span v-else class="pull-left " style="margin-left:0px">{{fmoney(displace.replacementSubsidy)}}</span>
                            <span style="position:absolute;left:170px;top: 3px;">元</span>
                        </td>-->
                    </tr>
                    <tr class="td-row2 td-value" style="height:30px">
                        <td style="color:black;background-color:#F8F8F8">实际交车日期</td>
                        <td class="td-value2">
                            <input type="text" v-model="displace.acturalDeliveryDate" v-if="showInput('实际交车日期')" @focus="acturalDeliveryDatePicker($event)">
                            <span v-else>{{displace.acturalDeliveryDate?displace.acturalDeliveryDate:""}}</span>
                        </td>
                    </tr>
                    <tr class="td-row2 td-value" style="height:30px">
                        <td style="color:black;background-color:#F8F8F8">机动车登记证书/行驶证/合同/协议/发票</td>
                        <td colspan="2">
                            <div id="divUploadedFiles">
                                <div class="fj-tanzhongStyle "  v-for="(attach,i) in displace.attaches">
                                    <b :class="fjStyle(attach.name)"></b>
                                    <div class="name" v-if="attach.name" :title="attach.name" v-on:click="download(attach.url,attach.name)">{{attach.name}}</div>
                                    <div class="down"><a href="javascript:void(0)" class="nui-txt-link" v-on:click="download(attach.url,attach.name)">下载</a></div>
                                    <div class="del" v-if="pageType!='look'&&attach.name"><a href="javascript:void(0)" class="nui-txt-link" @click.stop="deleteFileMore(i)" >删除</a></div>
                                    <!--<div class="info">11.35K <span class="nui-txt-suc">上传完成</span></div>-->
                                </div>
                               <!-- <div v-for="(attach,i) in displace.attaches" class="progressobj">
                                    <input type="button" class="IcoNormal" style="float:left;"/>
                                    <div class="filename" style="float:left;position: relative;top: 2px;"
                                         @click.stop="download(attach.url,attach.name)">
                                        {{attach.name}}
                                    </div>
                                    <div class="delfile">
                                        <span v-if="pageType=='edit'">
                                    <a href="javascript:void(0);" @click.stop="deleteFileMore(i)"><span
                                            style="font-weight: bold;"><b style="color: red">X</b></span></a>
                                </span>
                                    </div>
                                </div>-->
                            </div>
                        </td>
                        <td>
                            <div id="divUpload" v-if="showInput('合同')">
                                上传附件
                            </div>
                        </td>
                    </tr>
                    <tr  style="height:30px">
                        <td class="td-title" rowspan="2" style="line-height: 48px;">备注</td>
                        <td rowspan="2" colspan="3" class="td-value2 moreList" data-table="t_dvc_displace" data-column="remark" data-type='1'>
                            <textarea type="text" v-model="displace.remark" v-if="showInput('备注')" style="box-shadow: inset 1px 1px 4px #333;
                              width: 100%;height: 100%; position: absolute;top: 0;left: 0;"></textarea>
                            <span v-else class="lineOne"><span
                                    style="text-align: left;">{{displace.remark}}</span></span>
                        </td>
                    </tr>
                    <tr></tr>
                </table>
                <!--出库信息-->
                <table class="table  table-bordered text-center" id="outBound"
                       :style="(outBound.main.type==0&&isAdd!=1)?'display:;':'display:none'">
                    <tr>
                    <th colspan="6"  class="no-print title">
                        <span style="text-align:center;height:18px;">出库记录</span>
                    </th>
                    </tr>
                    <tr class="td-row2 td-value" style="height:30px;">
                        <td style="width: 17%;" class="td-title">出库类型</td>
                        <td style="" colspan="5" class="td-value2">
                            <!--<select class=" td-row2 td-value" id="outType" v-model="outType" v-if="pageType=='edit'"
                                    style=" padding-left: 2px;">
                                <option></option>
                                <option v-bind:value="0">出库</option>
                                <option v-bind:value="1">移库</option>
                                <option v-bind:value="2">退货</option>
                            </select>-->
                            <span>出库</span>
                        </td>
                    </tr>

                    <tr class="td-row2 td-value" style="height:30px;">
                        <td style="width: 17%;" class="td-title">提车地址</td>
                        <td style="" class="td-value2">
                            <!-- <input type="text" v-model="outBound.main.pickUpAddress" v-if="pageType=='edit'">-->
                            <span>{{outBound.main.pickUpAddress}}</span>
                        </td>
                        <td style="width: 17%;" class="td-title">联系人</td>
                        <td style="" class="td-value2">
                            <span>{{outBound.main.pickUpContacts}}</span>
                        </td>
                        <td style="width: 17%;" class="td-title">电话</td>
                        <td style="" class="td-value2">
                            <span>{{outBound.main.pickUpTelephone}}</span>
                        </td>
                    </tr>
                    <tr class="td-row2 td-value" style="height:30px;">
                        <td style="width: 211px;" class="td-title">交车地址</td>
                        <td style="width: 17%;" class="td-value2">
                            <span>{{outBound.main.delivery_address}}</span>
                        </td>
                        <td style="color:black;background-color:#F8F8F8">联系人</td>
                        <td style="width: 17%;" class="td-value2">
                            <span>{{outBound.main.deliveryContacts}}</span>
                        </td>
                        <td style="color:black;background-color:#F8F8F8">电话</td>
                        <td style="width: 17%;" class="td-value2">
                            <span>{{outBound.main.deliveryTelephone}}</span>
                        </td>
                    </tr>
                    <!--司机证件-->
                    <tr class="td-row2 td-value" style="height:30px">
                        <td style="color:black;background-color:#F8F8F8">司机证件</td>
                        <td colspan="5">
                            <div id="divUploadedFiles1">
                                <div class="fj-tanzhongStyle "  v-for="(attach,i) in outBound.certificates">
                                    <b :class="fjStyle(attach.name)"></b>
                                    <div class="name" v-if="attach.name" :title="attach.name" v-on:click="download(attach.url,attach.name)">{{attach.name}}</div>
                                    <div class="down"><a href="javascript:void(0)" class="nui-txt-link" v-on:click="download(attach.url,attach.name)">下载</a></div>
                                    <div class="del" v-if="showInput('0')"><a href="javascript:void(0)" class="nui-txt-link" @click.stop="deleteFileMoreDriverCertificate(i)">删除</a></div>
                                    <!--<div class="info">11.35K <span class="nui-txt-suc">上传完成</span></div>-->
                                </div>
                                <!--<div v-for="(attach,i) in outBound.certificates" class="progressobj">
                                    <input type="button" class="IcoNormal" style="float:left;cursor: pointer"
                                           v-on:click="download(attach.url,attach.name)"/>

                                    <div class="filename" style="float:left;cursor: pointer"
                                         @click.stop="download(attach.url,attach.name)">
                                        {{attach.name}}
                                    </div>
                                    <div class="delfile">
                                <span v-if="pageType=='edit'">
                                 <a href="javascript:void(0);" @click.stop="deleteFileMoreDriverCertificate(i)"><span
                                         style="font-weight: bold;position: relative;top: -1px;"><b
                                         style="color: red">X</b></span></a>
                                </span>
                                    </div>
                                    <div class="clearfix"></div>
                                </div>-->
                            </div>
                        </td>
                    </tr>
                    <!--设备照片-->
                    <tr class="td-row2 td-value" style="height:30px">
                        <td style="color:black;background-color:#F8F8F8">设备照片</td>
                        <td colspan="5">
                            <div id="divUploadedFiles2">
                                <div class="fj-tanzhongStyle "  v-for="(attach,i) in outBound.devicePictures">
                                    <b :class="fjStyle(attach.name)"></b>
                                    <div class="name" v-if="attach.name" :title="attach.name" v-on:click="download(attach.url,attach.name)">{{attach.name}}</div>
                                    <div class="down"><a href="javascript:void(0)" class="nui-txt-link" v-on:click="download(attach.url,attach.name)">下载</a></div>
                                    <div class="del" v-if="showInput('0')"><a href="javascript:void(0)" class="nui-txt-link" @click.stop="deleteFileMoreDevicePhoto(i)">删除</a></div>
                                    <!--<div class="info">11.35K <span class="nui-txt-suc">上传完成</span></div>-->
                                </div>
                                <!--<div v-for="(attach,i) in outBound.devicePictures" class="progressobj">
                                    <input type="button" class="IcoNormal" style="float:left;"/>
                                    <div class="filename" style="float:left;"
                                         @click.stop="download(attach.url,attach.name)">
                                        {{attach.name}}
                                    </div>
                                    <div class="delfile">
                                <span v-if="pageType=='edit'">
                             <a href="javascript:void(0);" @click.stop="deleteFileMoreDevicePhoto(i)"><span
                                     style="font-weight: bold;position: relative;top: -1px;"><b style="color: red">X</b></span></a>
                                </span>
                                    </div>
                                    <div class="clearfix"></div>
                                </div>-->
                            </div>
                        </td>
                    </tr>
                    <tr class="td-row2 td-value" style="height:30px">
                        <td style="color:black;background-color:#F8F8F8">备注</td>
                        <td colspan="5" class="td-value2">
                            <span class="lineOne">{{outBound.main.remark}}</span>
                        </td>
                    </tr>
                </table>
                <table class="table  table-bordered text-center" id="moveBound"
                       :style="(moveBound.main.type==1&&isAdd!=1)?'display:block;':'display:none'">
                    <th colspan="6"  class="title">
                        <span style="text-align:center;height:18px;">移库记录</span>
                    </th>
                    <tr class="td-row2 td-value" style="height:30px;">
                        <td style="width: 17%;" class="td-title">出库类型</td>
                        <td style="" colspan="5" class="td-value2">
                            <!--<select class=" td-row2 td-value" id="outType" v-model="outType" v-if="pageType=='edit'"
                                    style=" padding-left: 2px;">
                                <option></option>
                                <option v-bind:value="0">出库</option>
                                <option v-bind:value="1">移库</option>
                                <option v-bind:value="2">退货</option>
                            </select>-->
                            <span>移库</span>
                        </td>
                    </tr>

                    <tr class="td-row2 td-value" style="height:30px;">
                        <td style="width: 17%;" class="td-title">提车地址</td>
                        <td style="" class="td-value2">
                            <!-- <input type="text" v-model="outBound.main.pickUpAddress" v-if="pageType=='edit'">-->
                            <span>{{moveBound.main.pickUpAddress}}</span>
                        </td>
                        <td style="width: 17%;" class="td-title">联系人</td>
                        <td style="" class="td-value2"><!--<input type="text" v-model="moveBound.main.pickUpContacts"
                                                                           v-if="pageType=='edit'">-->
                            <span>{{moveBound.main.pickUpContacts}}</span>
                        </td>
                        <td style="width: 17%;" class="td-title">电话</td>
                        <td style="" class="td-value2"><!--<input type="text" v-model="moveBound.main.pickUpTelephone"
                                                                           v-if="pageType=='edit'">-->
                            <span>{{moveBound.main.pickUpTelephone}}</span>
                        </td>
                    </tr>

                    <tr class="td-row2 td-value" style="height:30px;">
                        <td style="width: 211px;" class="td-title">新库存地</td>
                        <td style="width: 17%;" class="td-value2">
                            <span>{{moveBound.main.delivery_address}}</span>
                        </td>
                        <td style="color:black;background-color:#F8F8F8">联系人</td>
                        <td style="width: 17%;" class="td-value2">
                            <span>{{moveBound.main.deliveryContacts}}</span>
                        </td>
                        <td style="color:black;background-color:#F8F8F8">电话</td>
                        <td style="width: 17%;" class="td-value2">
                            <span>{{moveBound.main.deliveryTelephone}}</span>
                        </td>
                    </tr>
                    <!--司机证件-->
                    <tr class="td-row2 td-value" style="height:30px">
                        <td style="color:black;background-color:#F8F8F8">司机证件</td>
                        <td colspan="5">
                            <div id="divUploadedFiles1">
                                <div class="fj-tanzhongStyle "  v-for="(attach,i) in moveBound.certificates">
                                    <b :class="fjStyle(attach.name)"></b>
                                    <div class="name" v-if="attach.name" :title="attach.name" v-on:click="download(attach.url,attach.name)">{{attach.name}}</div>
                                    <div class="down"><a href="javascript:void(0)" class="nui-txt-link" v-on:click="download(attach.url,attach.name)">下载</a></div>
                                    <div class="del" v-if="showInput('0')"><a href="javascript:void(0)" class="nui-txt-link" @click.stop="deleteFileMoreDriverCertificate(i)">删除</a></div>
                                    <!--<div class="info">11.35K <span class="nui-txt-suc">上传完成</span></div>-->
                                </div>
                              <!--  <div v-for="(attach,i) in moveBound.certificates" class="progressobj">
                                    <input type="button" class="IcoNormal" style="float:left;cursor: pointer"
                                           v-on:click="download(attach.url,attach.name)"/>
                                    <div class="filename" style="float:left;cursor: pointer"
                                         @click.stop="download(attach.url,attach.name)">
                                        {{attach.name}}
                                    </div>
                                    <div class="delfile">
                                <span v-if="pageType=='edit'">
                                 <a href="javascript:void(0);" @click.stop="deleteFileMoreDriverCertificate(i)"><span
                                         style="font-weight: bold;position: relative;top: -1px;"><b
                                         style="color: red">X</b></span></a>
                                </span>
                                    </div>
                                    <div class="clearfix"></div>
                                </div>-->
                            </div>
                        </td>
                    </tr>
                    <!--设备照片-->
                    <tr class="td-row2 td-value" style="height:30px">
                        <td style="color:black;background-color:#F8F8F8">设备照片</td>
                        <td colspan="5">
                            <div id="divUploadedFiles2">
                                <div class="fj-tanzhongStyle "  v-for="(attach,i) in moveBound.devicePictures">
                                    <b :class="fjStyle(attach.name)"></b>
                                    <div class="name" v-if="attach.name" :title="attach.name" v-on:click="download(attach.url,attach.name)">{{attach.name}}</div>
                                    <div class="down"><a href="javascript:void(0)" class="nui-txt-link" v-on:click="download(attach.url,attach.name)">下载</a></div>
                                    <div class="del" v-if="showInput('0')"><a href="javascript:void(0)" class="nui-txt-link" @click.stop="deleteFileMoreDevicePhoto(i)">删除</a></div>
                                    <!--<div class="info">11.35K <span class="nui-txt-suc">上传完成</span></div>-->
                                </div>
                                <!--<div v-for="(attach,i) in moveBound.devicePictures" class="progressobj">
                                    <input type="button" class="IcoNormal" style="float:left;"/>
                                    <div class="filename" style="float:left;"
                                         @click.stop="download(attach.url,attach.name)">
                                        {{attach.name}}
                                    </div>
                                    <div class="delfile">
                                <span v-if="pageType=='edit'">
                             <a href="javascript:void(0);" @click.stop="deleteFileMoreDevicePhoto(i)"><span
                                     style="font-weight: bold;position: relative;top: -1px;"><b style="color: red">X</b></span></a>
                                </span>
                                    </div>
                                    <div class="clearfix"></div>
                                </div>
                            </div>-->
                            </div>
                        </td>
                    </tr>
                    <tr class="td-row2 td-value" style="height:30px">
                        <td style="color:black;background-color:#F8F8F8">备注</td>
                        <td colspan="5" class="td-value2">
                            <span class="lineOne">{{moveBound.main.remark}}</span>
                        </td>
                    </tr>
                </table>
                <table class="table  table-bordered text-center" id="returnBound"
                       :style="(returnBound.main.type==2&&isAdd!=1)?'display:block;':'display:none'">
                    <th colspan="6"  class="title">
                        <span style="text-align:center;height:18px;">退货记录</span>
                    </th>
                    <tr class="td-row2 td-value" style="height:30px;">
                        <td style="width: 17%;" class="td-title">出库类型</td>
                        <td style="" class="td-value2">
                            <span>退货</span>
                        </td>
                    </tr>
                    <tr class="td-row2 td-value" style="height:30px;">
                        <td style="width: 17%;" class="td-title">提车地址</td>
                        <td style="" class="td-value2">
                            <span>{{returnBound.main.pickUpAddress}}</span>
                        </td>
                        <td style="width: 17%;" class="td-title">联系人</td>
                        <td style="" class="td-value2">
                            <span>{{returnBound.main.pickUpContacts}}</span>
                        </td>
                        <td style="width: 17%;" class="td-title">电话</td>
                        <td style="" class="td-value2">
                            <span>{{returnBound.main.pickUpTelephone}}</span>
                        </td>
                    </tr>
                    <tr class="td-row2 td-value" style="height:30px;">
                        <td style="width: 211px;" class="td-title">退库地址</td>
                        <td style="width: 17%;" class="td-value2">
                            <span>{{returnBound.main.delivery_address}}</span>
                        </td>
                        <td style="color:black;background-color:#F8F8F8">联系人</td>
                        <td style="width: 17%;" class="td-value2">
                            <span>{{returnBound.main.deliveryContacts}}</span>
                        </td>
                        <td style="color:black;background-color:#F8F8F8">电话</td>
                        <td style="width: 17%;" class="td-value2">
                            <span>{{returnBound.main.deliveryTelephone}}</span>
                        </td>
                    </tr>
                    <!--司机证件-->
                    <tr class="td-row2 td-value" style="height:30px">
                        <td style="color:black;background-color:#F8F8F8">司机证件</td>
                        <td colspan="5">
                            <div id="divUploadedFiles1">
                                <div class="fj-tanzhongStyle "  v-for="(attach,i) in returnBound.certificates">
                                    <b :class="fjStyle(attach.name)"></b>
                                    <div class="name" v-if="attach.name" :title="attach.name" v-on:click="download(attach.url,attach.name)">{{attach.name}}</div>
                                    <div class="down"><a href="javascript:void(0)" class="nui-txt-link" v-on:click="download(attach.url,attach.name)">下载</a></div>
                                    <div class="del" v-if="showInput('0')"><a href="javascript:void(0)" class="nui-txt-link" @click.stop="deleteFileMoreDriverCertificate(i)">删除</a></div>
                                    <!--<div class="info">11.35K <span class="nui-txt-suc">上传完成</span></div>-->
                                </div>
                                <!--<div v-for="(attach,i) in returnBound.certificates" class="progressobj">
                                    <input type="button" class="IcoNormal" style="float:left;cursor: pointer"
                                           v-on:click="download(attach.url,attach.name)"/>
                                    <div class="filename" style="float:left;cursor: pointer"
                                         @click.stop="download(attach.url,attach.name)">
                                        {{attach.name}}
                                    </div>
                                    <div class="delfile">
                                <span v-if="pageType=='edit'">
                                 <a href="javascript:void(0);" @click.stop="deleteFileMoreDriverCertificate(i)"><span
                                         style="font-weight: bold;position: relative;top: -1px;"><b
                                         style="color: red">X</b></span></a>
                                </span>
                                    </div>
                                    <div class="clearfix"></div>
                                </div>-->
                            </div>
                        </td>
                    </tr>
                    <!--设备照片-->
                    <tr class="td-row2 td-value" style="height:30px">
                        <td style="color:black;background-color:#F8F8F8">上传附件</td>
                        <td colspan="5">
                            <div id="divUploadedFiles2">
                                <div class="fj-tanzhongStyle "  v-for="(attach,i) in returnBound.devicePictures">
                                    <b :class="fjStyle(attach.name)"></b>
                                    <div class="name" v-if="attach.name" :title="attach.name" v-on:click="download(attach.url,attach.name)">{{attach.name}}</div>
                                    <div class="down"><a href="javascript:void(0)" class="nui-txt-link" v-on:click="download(attach.url,attach.name)">下载</a></div>
                                    <div class="del" v-if="showInput('0')"><a href="javascript:void(0)" class="nui-txt-link" @click.stop="deleteFileMoreDevicePhoto(i)">删除</a></div>
                                    <!--<div class="info">11.35K <span class="nui-txt-suc">上传完成</span></div>-->
                                </div>
                               <!-- <div v-for="(attach,i) in returnBound.devicePictures" class="progressobj">
                                    <input type="button" class="IcoNormal" style="float:left;"/>
                                    <div class="filename" style="float:left;"
                                         @click.stop="download(attach.url,attach.name)">
                                        {{attach.name}}
                                    </div>
                                    <div class="delfile">
                                <span v-if="pageType=='edit'">
                             <a href="javascript:void(0);" @click.stop="deleteFileMoreDevicePhoto(i)"><span
                                     style="font-weight: bold;position: relative;top: -1px;"><b style="color: red">X</b></span></a>
                                </span>
                                    </div>
                                    <div class="clearfix"></div>
                                </div>-->
                            </div>
                        </td>
                    </tr>
                    <tr class="td-row2 td-value" style="height:30px">
                        <td style="color:black;background-color:#F8F8F8">备注</td>
                        <td colspan="5" class="td-value2">
                            <span class="lineOne">{{returnBound.main.remark}}</span>
                        </td>
                    </tr>
                </table>
                <!--审批进度-->
                <table class="table-detail no-print" style="border-top-width:0px;" v-if="displace.auditId!=''">
                    <tr>
                        <td class=" title" colspan="4">审批进度</td>
                    </tr>
                    <tr>
                        <td class="td-title" style="width:17%;">审核人员</td>
                        <td class="td-title" style="width:16%;">审核状态</td>
                        <td class="td-title" style="width:17%;">审核时间</td>
                        <td class="td-title">审核意见</td>
                    </tr>
                    <!--<tr v-for="itemAudit in auditHistorys">
                        <td><span>{{itemAudit.auditorName}}</span></td>
                        <td><span>{{convertAuditFlagToNameNew(itemAudit.auditFlag)}}</span></td>
                        <td><span>{{itemAudit.auditTime}}</span></td>
                        <td><span>{{itemAudit.auditAdvise}}</span></td>
                    </tr>-->
                    <tr>
                        <td >
                            <span>{{displace.auditName}}-{{displace.auditRoleName}}</span>
                        </td>
                        <td>
                            <span v-if="displace.auditFlag==0" style="color:red;">{{convertAuditFlagToName(displace.auditFlag)}}</span>
                            <span v-else>{{convertAuditFlagToName(displace.auditFlag)}}</span>
                        </td>
                        <td>
                            <span v-if="displace.auditFlag==0"></span>
                            <span v-else>{{displace.auditTime}}</span>
                        </td>
                        <td>
                            <!-- <input type="text" v-model="displace.auditAdvise" v-if="pageType=='audit'"/>-->
                            <span >{{displace.auditAdvise}}</span>
                        </td>
                    </tr>
                </table>
                <div style="padding: 10px 0;text-align:center;" v-if="pageType=='edit'">
                    <input type="button" id="saveDraft" class="btn btn-primary btn-sm" @click="save(-1)" value="保存草稿"
                           v-if="pageType=='edit'">
                    <input type="button" id="save" class="btn btn-primary btn-sm" @click="save(0)" value="提交申请"
                           v-if="pageType=='edit'">
                </div>
                <div style="padding: 10px 0;text-align:center;" v-if="pageType=='audit'&&displace.auditId==userId">
                    <input type="button" id="pass" class="btn btn-primary btn-sm" @click="applyAudit(1)" value="通过">
                    <input type="button" id="return" class="btn btn-primary btn-sm" @click="applyAudit(2)" value="驳回">
                </div>
            </div>
        </div>
    </div>
</section>
</body>
<!--JQ-->
<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
<!--插件JS-->
<script src="https://file.ggxqce.com/web/bootstrap.min.js"></script>
<!--框架已定义 JS-->
<script src="/dist/js/app_iframe.js?t=0b5caf39"></script>
<!--oa自定义  JS-->
<script src="/dist/js/oa.js?t=0c4d95a9"></script>
<script type="text/javascript" src="/dist/plugins/My97DatePicker/WdatePicker.js"></script>
<script src="https://file.ggxqce.com/web/vue.min.js"></script>
<!--ztree组件所需js-->
<script type="text/javascript" src="/dist/plugins/ztree/js/jquery.ztree.all-3.5.min.js"></script>
<script type="text/javascript" src="/dist/plugins/ztree/js/jquery.ztree.exhide-3.5.js"></script>
<script src="/dist/plugins/webuploader-0.1.5/webuploader.min.js"></script>
<script type="text/javascript" src="/dist/js/pages/common/commonService.js"></script>
<script type="text/javascript" src="/dist/js/pages/common/changeMoneyToChinese.js"></script>
<script type="text/javascript" src="/dist/plugins/print/print.js"></script>
<script type="text/javascript" src="/dist/plugins/lhgdialog/lhgdialog.min.js?self=true"></script>
<script src="/dist/js/pages/wreport/Template.js?t=42e28def"></script>
<script>
    $(function () {
        $("body").on("click", ".lineOne", function (e) {
            if ($(".div-td-content-more").is(":hidden")) {
                var text = $(this).text();
                if (text != "") {
                    text = "<i></i>" + text;
                    $(".div-td-content-more").html(text).css({
                        "width": $(this).outerWidth() + "px",
                        "left": $(this).offset().left,
                        "top": ($(this).offset().top + $(this).outerHeight()) + "px"
                    }).show();
                    e.stopPropagation();
                }
            } else {
                $(".div-td-content-more").hide();
            }
        });
        $("body").on("click", ".div-td-content-more", function (e) {
            e.stopPropagation();
        });
        $("body").on("click", function () {
            $(".div-td-content-more").hide();
        });
    });
    $(function () {
        $("body").on("click", ".moreList", function (e) {
            var tableName = $(this).attr("data-table");
            var column = $(this).attr("data-column");
            var columnName = $(this).attr("data-columnName");
            var mainKey = $(this).attr("data-column");
            var mid = $(this).attr("data-mid");
            var type = $(this).attr("data-type");
            if ($(this).hasClass("jiaobiao3")) {
                $.dialog({
                    content:'url:/page/logs/logs.html?tableName=' + tableName + '&column=' + column+'&columnName=' + columnName + "&mainKey=" + mainKey + "&mid=" + mid + '&type='+type+'&id='+app.displace.id,
                    title: '修改日志',
                    width:600,
                    height:500,
                    max: false,
                    min: false,
                    lock: true
                });
            }
        });
        $("body").on("click", ".moreListData", function (e) {
            e.stopPropagation();
        });
        $("body").on("click", function () {
            $(".moreListData").hide();
        });
    });
</script>
<script type="text/javascript">
    //var api = frameElement.api, W = api.opener;
    Vue.directive('onedate', {
        // 当被绑定的元素插入到 DOM 中时……
        update: function (el, binding) {
            // 聚焦元素
            if (app.pageType == 'edit') {
                if (el.value == "NaN.undefined" || el.value == "") {
                    el.value = binding.value
                }
            }
        },
        componentUpdated: function (el, binding) {
            // 聚焦元素
        }
    })
    var app = new Vue({
        el: '#app',
        data: {
            title:$.wyui.page.urlParams.title,
            openType: $.wyui.page.urlParams.openType ? $.wyui.page.urlParams.openType : 'top',
            userId: getCurrentUser().id,
            isAdd: $.wyui.page.urlParams.isAdd,
            pageType: $.wyui.page.urlParams.pageType,
            itemsType: [],
            itemsCom: [],
            stocks: [],//库存地
            regions: [],//区域
            bigRegionManager: [],//大区经理
            regionManager: [],//区域经理
            auditHistorys: [],//历史审核记录
            selectCom: '',
            outType: '0',
            deviceAttach: [],
            change: 0,
            transferList: [
                {text: '', value: ''},
                {text: '已更名-未过户', value: '已更名-未过户'},
                {text: '已过户', value: '已过户'},
                {text: '未更名', value: '未更名'}
            ],
            displace: {
                customerName:"",
                replacementDeviceBrandName:"",
                replacementDeviceSequence:"",
                replacementDeviceModelName:"",
                id: $.wyui.page.urlParams.id,
                createUserId: getCurrentUser().id,
                createUserName: getCurrentUser().name,
                fkCompanyId: '',
                companyName: '',
                brandName: '',
                sequence: '',
                modelName: '',
                houseName: '',
                houseAddress: '',
                state: '',
                buildingNumber: '',
                area: '',
                remark: '',
                housesProperty: '',
                replacementPrice: '',
                replacementsName: '',
                estimatePrice: '',
                replacementSubsidy: '',
                regionId: '',
                regionName: '',
                regionManagerId: '',
                regionManagerName: '',
                bigregionManagerId: '',
                bigregionManagerName: '',
                sellPrice: '',
                transfer: '',//是否可过户
                insuranceExpirationDate: '',//保险到期日
                kilometers:'',//公里数
                storeAddress: '',
                type: '2',//1-旧挖掘机，2-旧汽车，3-旧房屋，
                delFlag: '0',
                replacementType: '',
                deviceAnnexName: '',
                deviceAnnexUrl: '',
                squence: '',
                attaches: [],//附件
                //审核字段
                auditFlag: -1,
                auditId: '',
                auditName: '',
                auditRoleName: '',
                auditTime: '',
                auditAdvise: '',
                /*运输信息*/
                departure: '',
                departureContactName: '',
                departureContactTel: '',
                destination: '',
                destinationContactName: '',
                destinationContactTel: '',
                transportCompany: '',
                traComContactName: '',
                traComContactTel: '',
                modelCarLicense: '',
                driverName: '',
                driverTel: '',
                freight: '',
                deduction: '',
                deductionInstructions: '',
                modelCarPhotoName: '',
                modelCarPhotoUrl: '',
                driverCertificateName: '',
                driverCertificateUrl: '',
                devicePhotoName: '',
                devicePhotoUrl: '',
                transportState: 0,
            },
            /*物流信息变更*/
            transportChange: {
                id: '',
                changeReason: '',
                newDeparture: '',
                destination: '',
                destinationContactName: '',
                destinationContactTel: '',
                displaceCompany: '',
                traComContactName: '',
                traComContactTel: '',
                modelCarLicense: '',
                driverName: '',
                driverTel: '',
                freight: '',
                deduction: '',
                deductionInstructions: '',
                cmodelCarPhotoName: '',
                cmodelCarPhotoUrl: '',
                cdriverCertificateName: '',
                cdriverCertificateUrl: '',
                cdevicePhotoName: '',
                cdevicePhotoUrl: '',
            },
            /*出库*/
            outBound: {
                certificates: [],//司机证件
                devicePictures: [],//设备照片
                drayPictures: [],//板车照片
                attaches: [],
                main: {
                    id: '',
                    sampleId: '',
                    type: -1,//出库类型0-出库，1-移库，2-退货
                    pickUpAddress: '',//提车地址
                    pickUpContacts: '',//提车联系人
                    pickUpTelephone: '',//提车电话
                    delivery_address: '',//轿车地址
                    deliveryContacts: '',
                    deliveryTelephone: '',
                    transport_company: '',//运输公司
                    contacts: '',//运输公司联系人
                    telephone: '',//电话
                    dray_license: '',//板车车牌
                    driver_name: '',//司机姓名
                    driver_tel: '',
                    special_fee: 0.00,//运费
                    deduction_fee: 0.00,//扣款
                    deduction_remark: '',//扣款说明
                    remark: '',
                    trafficDestination: '',
                    trafficStarting: '',
                    reason: '',
                    createTime: '',
                    updateTime: '',
                    contractId: '',
                }
            },
            moveBound: {
                certificates: [],//司机证件
                devicePictures: [],//设备照片
                drayPictures: [],//板车照片
                attaches: [],
                main: {
                    id: '',
                    sampleId: '',
                    type: -1,//出库类型0-出库，1-移库，2-退货
                    pickUpAddress: '',//提车地址
                    pickUpContacts: '',//提车联系人
                    pickUpTelephone: '',//提车电话
                    delivery_address: '',//轿车地址
                    deliveryContacts: '',
                    deliveryTelephone: '',
                    transport_company: '',//运输公司
                    contacts: '',//运输公司联系人
                    telephone: '',//电话
                    dray_license: '',//板车车牌
                    driver_name: '',//司机姓名
                    driver_tel: '',
                    special_fee: 0.00,//运费
                    deduction_fee: 0.00,//扣款
                    deduction_remark: '',//扣款说明
                    remark: '',
                    trafficDestination: '',
                    trafficStarting: '',
                    reason: '',
                    createTime: '',
                    updateTime: '',
                    contractId: '',
                }
            },
            returnBound: {
                certificates: [],//司机证件
                devicePictures: [],//设备照片
                drayPictures: [],//板车照片
                attaches: [],
                main: {
                    id: '',
                    sampleId: '',
                    type: -1,//出库类型0-出库，1-移库，2-退货
                    pickUpAddress: '',//提车地址
                    pickUpContacts: '',//提车联系人
                    pickUpTelephone: '',//提车电话
                    delivery_address: '',//轿车地址
                    deliveryContacts: '',
                    deliveryTelephone: '',
                    transport_company: '',//运输公司
                    contacts: '',//运输公司联系人
                    telephone: '',//电话
                    dray_license: '',//板车车牌
                    driver_name: '',//司机姓名
                    driver_tel: '',
                    special_fee: 0.00,//运费
                    deduction_fee: 0.00,//扣款
                    deduction_remark: '',//扣款说明
                    remark: '',
                    trafficDestination: '',
                    trafficStarting: '',
                    reason: '',
                    createTime: '',
                    updateTime: '',
                    contractId: '',
                }
            },

        },
        methods: {
            loss:function (r) {
                var that=this;
                that.displace.lossMoney=that.displace.replacementPrice-r;

            },
            showToday:function (updateTime) {
                var dateTime = new Date().Format("yyyy-MM-dd");
                if(dateTime==updateTime){
                    return true;
                }else{
                    return false;
                }
            },
            fjStyle:function(fjName){
                if(fjName){
                    var type=fjName.substring(fjName.lastIndexOf('.') + 1);
                    return 'img fj-'+type
                }
                return 'img'
            },
            showInput: function (type) {
                var pageType = $.wyui.page.urlParams.pageType;
                //草稿、驳回状态可重新编辑
                var auditFlag = $.wyui.page.urlParams.auditFlag
                var state = $.wyui.page.urlParams.state;
                var that=this;
                if (auditFlag == "-1" || (auditFlag == "2"&& state == '提车在途')) {
                    that.isAdd=1;
                }
                var str1 = "状态、区域、区域经理、大区经理、是否过户、保险到期日、出售价格、合同、备注、评估价格、置换价格、公里数、实际交车日期";
                if (pageType=='edit'&&that.isAdd==1) {
                    return true;
                }
                if (pageType=='edit'&&that.isAdd==0) {
                    if(str1.indexOf(type) != -1){
                        return true;
                    }else {
                        return false;
                    }
                }
                if (pageType=='look'&&that.isAdd==0) {
                    return false;
                }
            },
            save: function (auditFlag) {
                var that = this;
                if ("" == that.selectCom) {
                    alert("请输入归属公司")
                    return;
                }
                if ("" == that.displace.brandName) {
                    alert("请输入品牌")
                    return;
                }
                if ("" == that.displace.sequence) {
                    alert("请输入车架号")
                    return;
                }
                if ("" == that.displace.modelName) {
                    alert("请输入型号")
                    return;
                }
                if ("" == that.displace.state) {
                    alert("请输入状态")
                    return;
                }
                if (that.change == 1) {
                    if ("" == that.transportChange.changeReason) {
                        alert("请输入变更原因")
                        return;
                    } else {
                        that.displace.transportState = 1;
                        that.transportChange.deviceId = that.displace.id;
                    }
                }
                if (!that.displace.estimatePrice){
                    that.displace.estimatePrice=0.00
                }
                if (!that.displace.replacementPrice){
                    that.displace.replacementPrice=0.00
                }
                if (!that.displace.sellPrice){
                    that.displace.sellPrice=0.00
                }
                if (!that.displace.replacementSubsidy){
                    that.displace.replacementSubsidy=0.00
                }
                /*库存地判断*/
                /*if (that.displace.state != '库存') {
                    that.displace.storeAddress = ''
                } else*/ if (that.displace.state == '库存' && that.moveBound.main.type == 1) {
                    that.displace.storeAddress = that.moveBound.main.delivery_address
                }
                that.displace.auditFlag = auditFlag;//审核状态
                that.displace.fkCompanyId = that.selectCom;

                if (that.isAdd == 1) {
                    that.displace.companyName = $("#testCom option:selected").text();

                        that.outBound.main.type = that.outType
                }
                that.displace.updateUserId=getCurrentUser().id;
                that.displace.updateUserName=getCurrentUser().name;
               delete that.displace.createTime;
                if(auditFlag==0){
                    if(that.title=='旧汽车出库'){
                        that.displace.state='交付在途';
                        //                    if('张静,王雅玲'.indexOf(getCurrentUser().name)!=-1){
                        //                        that.displace.auditFlag=1;
                        //                    }else{
                        //                        that.displace.auditFlag=0;
                        //                    }
                    }else{
                        if(that.displace.state=='交付在途')
                            that.displace.state='已交'
                        //编辑
                        if(getCurrentUser().roleName=='订货支持'&&(that.displace.state=='提车在途'||that.displace.state=='库存')){
                            that.displace.auditFlag=1;
                        }
                    }
                }
               var data={'displace':that.displace,
                   'transportChange': that.transportChange,
                   'moveBound': that.moveBound,
                   'returnBound': that.returnBound}
                $("input").attr("disabled","disabled");
                $.wyui.postMethod('/deviceDisplace/saveOldSampleNew.json', trimRN(data), function (r) {
                    var records = r.records;
                    if (records == '保存成功') {
                        var title;
                        if(auditFlag=='-1'){
                            title='保存草稿成功'
                        }else{
                            title='提交成功'
                        }
                        top.$.alert({
                            title: title,
                            content: '',
                            icon: '1', //1成功 2失败 3提示 不穿代表无图标
                            height: 180,
                            width: 300,

                            blankclose: true,//点击空白是否可关闭
                            cancel: "确定",
                            cancelCallback:function(em, opts){
                                em.remove()
                                opts.close && opts.close()
                                var pageId = top.getActivePageId();
                                var $iframe = top.findIframeByName("库存管理");
                                $iframe[0].contentWindow.$("#iframeBox")[0].contentWindow.app.sel();
                                top.closeTabByPageId(pageId);
                            }
                        })
                    } else {
                        alert("汽车信息保存失败，请重新输入");
                        window.location.reload()
                    }
                });
            },
            copierReturn: function () {
                var that = this;
                $.dialog({
                    content: 'url:/page/device/sample/copierReturnReason.html?id=' + that.displace.id + "&type=2&openType="+that.openType,
                    title: '填写驳回原因',
                    width: 300,
                    height: 200,
                    max: false,
                    min: false,
                    lock: true
                });
            },
            applyAudit: function (auditFlag) {
                if (auditFlag == "2") {
                } else {
                    if (!confirm("确定要通过吗？")) {
                        return;
                    }
                }
                var that = this;
                if (auditFlag == '2') {
                    that.copierReturn();
                    //alert('请填写审核意见');
                    return;
                }
                if (that.displace.auditAdvise == "") {
                    that.displace.auditAdvise = "同意！";
                }
                $.wyui.postMethod('/deviceDisplace/applyAudit.json', {
                    id: that.displace.id,
                    userId: getCurrentUser().id,
                    roleName: getCurrentUser().roleName,
                    type: that.displace.type,
                    auditFlag: auditFlag,
                    advise: that.displace.auditAdvise
                }, function (r) {
                    if (that.openType == 'top') {
                        alert("审核成功");
                        var pageId = top.getActivePageId();
                        var $iframe = top.findIframeByName("库存管理");
                        $iframe[0].contentWindow.$("#iframeBox")[0].contentWindow.refresh();
                        top.closeTabByPageId(pageId);
                        /* var $iframe = top.findIframeByName("库存管理");
                    $iframe[0].contentWindow.$("#iframeBox")[0].contentWindow.refresh();
                    api.close();*/
                   }else{
                        window.location.href = "oldCarDetail.html?pageType=look&&id=" + that.displace.id+"";
                    }
                })


            },
            convertAuditFlagToName: function (auditFlag) {
                //auditFlag:-1,0,1,2,3,4,5,6
                switch (auditFlag) {
                    case -1:
                        return "未提交";
                        break;
                    case 0:
                        return "审核中";
                        break;
                    case 1:
                        return "通过";
                        break;
                    case 2:
                        return "驳回";
                        break;
                    default :
                        break;
                }
            },
            convertAuditFlagToNameNew: function (auditFlag) {
                //auditFlag:-1,0,1,2,3,4,5,6
                switch (auditFlag) {
                    case "-1":
                        return "未提交";
                        break;
                    case "0":
                        return "审核中";
                        break;
                    case "1":
                        return "通过";
                        break;
                    case "2":
                        return "驳回";
                        break;
                    default :
                        break;
                }
            },
            acturalDeliveryDatePicker: function (e) {
                var that = this;
                WdatePicker({
                    onpicked: function (dp) {
                        that.displace.acturalDeliveryDate = dp.cal.getNewDateStr();
                        return true;
                    }
                });
                $(e.target).blur();
            },
            showDatePicker: function (e) {
                var that = this;
                WdatePicker({
                    onpicked: function (dp) {
                        that.displace.insuranceExpirationDate = dp.cal.getNewDateStr();
                        return true;
                    }
                });
                $(e.target).blur();
            },
            showDatePickerYear: function (e) {
                var that = this;
                WdatePicker({
                    onpicked: function (dp) {
                        that.displace.factoryDate = dp.cal.getNewDateStr();
                        return true;
                    },
                    dateFmt: 'yyyy'
                });
                $(e.target).blur();
            },
            close: function () {
                api.close();
            },

            deleteFile: function (item) {
                if (window.confirm("确定要删除该附件吗?")) {
                    console.log(item)
                    this.displace[item + "Name"] = "";
                    this.displace[item + "Url"] = "";
                    $("#" + item).show();
                }
            },
            deleteFileTransportChange: function (item) {
                if (window.confirm("确定要删除该附件吗?")) {
                    console.log(item)
                    this.transportChange[item + "Name"] = "";
                    this.transportChange[item + "Url"] = "";
                    $("#" + item).show();
                }
            },
            download: function (attachId, fileName) {
                downloadFile(attachId,fileName)
                return false;
            },

            changeTransport: function () {
                var that = this;
                that.change = 1;
            },
            deleteChange: function () {
                var that = this;
                that.change = 0;
            },
            uploadMore: function () {
                //上传附件
                var that = this;
                this.uploader = WebUploader.create({
                    // 选完文件后，是否自动上传。
                    auto: true,
                    // swf文件路径
                    swf: "/statics/plugin/webuploader-0.1.5/Uploader.swf",
                    // 文件接收服务端。
                    server: server.fjIp + "/attach/uploadFile.json",
                    // 选择文件的按钮。可选。
                    // 内部根据当前运行是创建，可能是input元素，也可能是flash.
                    pick: '#divUpload',
                    duplicate: true
                });
                this.uploader.on("uploadStart", function () {
                    $("#progress").show();
                });
                this.uploader.on("uploadComplete", function () {
                    $("#progress").hide();
                });
                // 文件上传成功，给item添加成功class, 用样式标记上传成功。
                this.uploader.on('uploadSuccess', function (file, response) {
                    if (response._raw == "文件上传出错！") {
                        alert("文件上传出错！");
                    } else {
                        that.displace.attaches.push({
                            id: response.id,
                            name: response.name,
                            url: response.url
                        });
                    }
                });
                // 文件上传失败，显示上传出错。
                this.uploader.on('uploadError', function (file) {
                    alert("上传失败！");
                });
            },
            uploadOutMore: function () {
                //上传附件
                var that = this;
                this.uploader = WebUploader.create({
                    // 选完文件后，是否自动上传。
                    auto: true,
                    // swf文件路径
                    swf: "/statics/plugin/webuploader-0.1.5/Uploader.swf",
                    // 文件接收服务端。
                    server: server.fjIp + "/attach/uploadFile.json",
                    // 选择文件的按钮。可选。
                    // 内部根据当前运行是创建，可能是input元素，也可能是flash.
                    pick: '#divUpload1',
                    duplicate: true
                });
                this.uploader.on("uploadStart", function () {
                    $("#progress").show();
                });
                this.uploader.on("uploadComplete", function () {
                    $("#progress").hide();
                });
                // 文件上传成功，给item添加成功class, 用样式标记上传成功。
                this.uploader.on('uploadSuccess', function (file, response) {
                    if (response._raw == "文件上传出错！") {
                        alert("文件上传出错！");
                    } else {
                        that.outBound.certificates.push({
                            id: response.id,
                            name: response.name,
                            url: response.url
                        });
                    }
                });
                // 文件上传失败，显示上传出错。
                this.uploader.on('uploadError', function (file) {
                    alert("上传失败！");
                });
            },
            uploadOutMore2: function () {
                //上传附件
                var that = this;
                this.uploader = WebUploader.create({
                    // 选完文件后，是否自动上传。
                    auto: true,
                    // swf文件路径
                    swf: "/statics/plugin/webuploader-0.1.5/Uploader.swf",
                    // 文件接收服务端。
                    server: server.fjIp + "/attach/uploadFile.json",
                    // 选择文件的按钮。可选。
                    // 内部根据当前运行是创建，可能是input元素，也可能是flash.
                    pick: '#divUpload2',
                    duplicate: true
                });
                this.uploader.on("uploadStart", function () {
                    $("#progress").show();
                });
                this.uploader.on("uploadComplete", function () {
                    $("#progress").hide();
                });
                // 文件上传成功，给item添加成功class, 用样式标记上传成功。
                this.uploader.on('uploadSuccess', function (file, response) {
                    if (response._raw == "文件上传出错！") {
                        alert("文件上传出错！");
                    } else {
                        that.outBound.devicePictures.push({
                            id: response.id,
                            name: response.name,
                            url: response.url
                        });
                    }
                });
                // 文件上传失败，显示上传出错。
                this.uploader.on('uploadError', function (file) {
                    alert("上传失败！");
                });
            },
            deleteFileMore: function (i) {
                if (window.confirm("确定要删除该附件吗?")) {
                    this.displace.attaches.splice(i, 1);
                }
            },
            deleteFileMoreDevicePhoto: function (i) {
                if (window.confirm("确定要删除该附件吗?")) {
                    this.outBound.devicePictures.splice(i, 1);
                }
            },
            deleteFileMoreDriverCertificate: function (i) {
                if (window.confirm("确定要删除该附件吗?")) {
                    this.outBound.certificates.splice(i, 1);
                }
            },
            /*获取库存地*/
            getBran: function () {
                var that = this;
                var s = that.selectCom;
                that.selectStock = '请选择库存地';
                $.wyui.postMethod('/company/getCompanyById.json', {id: s}, function (r) {
                    that.stocks = r.stock;
                })
                /*查询区域*/
                $.wyui.postMethod('/deviceDisplace/findRegionByCompanyId.json', {companyId: s}, function (r) {
                    that.regions = r.regions;
                })
            },
            getBigRegionManager: function () {
                var that = this;
                $.wyui.postMethod('/deviceDisplace/findBigRegionManagerByRegionId.json', {regionId: that.displace.regionId}, function (r) {
                    that.bigRegionManager = r.regions;
                })
            },
            getRegionManager: function () {
                var that = this;
                $.wyui.postMethod('/deviceDisplace/findRegionManagerByBigRegionManagerId.json', {bigRegionId: that.displace.regionId}, function (r) {
                    that.regionManager = r.regions;
                })
            },
            /*数字判断限制*/
            fmoney: function (s, n) {
                n = n > 0 && n <= 20 ? n : 2;
                s = parseFloat((s + "").replace(/[^\d\.-]/g, "")).toFixed(n) + "";
                var l = s.split(".")[0].split("").reverse(), r = s.split(".")[1],
                    t = "";
                for (i = 0; i < l.length; i++) {
                    t += l[i] + ((i + 1) % 3 == 0 && (i + 1) != l.length ? "," : "");
                }
                return t.split("").reverse().join("") + "." + r;
            },
            strFormat: function (target, data) {
                //此结果为了展示数据
                var value = (target.value).trim();
                value = value.replace(/[^\d{1,}\.\d{1,}|\d{1,}]/g, '');
                if (!value) {
                    value = 0
                }
                ;
                //此结果为data存入数据
                var dataList = data.split('.');

                if (dataList.length > 0) {
                    if (dataList.length == 1) {
                        this[dataList[0]] = value;
                    }
                    if (dataList.length == 2) {
                        this[dataList[0]][dataList[1]] = value;
                    }
                    if (dataList.length == 3) {
                        this[dataList[0]][dataList[1]][dataList[2]] = value;
                    }
                    if (dataList.length == 4) {
                        this[dataList[0]][dataList[1]][dataList[2]][dataList[3]] = value;
                    }
                    if (dataList.length == 5) {
                        this[dataList[0]][dataList[1]][dataList[2]][dataList[3]][dataList[4]] = value;
                    }
                }
                target.value = this.fmoney(value);
            },
            strFormatF: function (target, data) {
                var value = '';
                var dataList = data.split('.');

                if (dataList.length > 0) {
                    if (dataList.length == 1) {
                        value = this[dataList[0]]
                    }
                    if (dataList.length == 2) {
                        value = this[dataList[0]][dataList[1]]
                    }
                    if (dataList.length == 3) {
                        value = this[dataList[0]][dataList[1]][dataList[2]]
                    }
                    if (dataList.length == 4) {
                        value = this[dataList[0]][dataList[1]][dataList[2]][dataList[3]]
                    }
                    if (dataList.length == 5) {
                        value = this[dataList[0]][dataList[1]][dataList[2]][dataList[3]][dataList[4]]
                    }
                }
                if (!value || value == '0.00') {
                    console.log('获取焦点', value)
                    value = '';
                }
                target.value = value;
            },
            //获取日志
            getMoreHistory:function () {
                var that=this;
                $(".moreList").each(function() {
                    console.log($(this));
                    var demo = $(this);
                    var tableName = $(this).attr("data-table");
                    var type = $(this).attr("data-type");
                    if(type=='1'){
                        var columnName = $(this).attr("data-column");
                        $.wyui.postMethod("/logs/getColumnLogsNum.json", {
                            "tableName":tableName,
                            "columnName":columnName,
                            "updateId":that.displace.id
                        }, function (data) {
                            console.log(data)
                            if (data.result) {
                                var p = new Array();
                                p.push("<i></i>");
                                demo.addClass("jiaobiao3");
                                if(that.showToday(data.updateTime)){
                                    demo.children("span").css("color","#ff0000");
                                }
                                demo.append(p.join(""))
                            }
                        })
                    }
                    else if(type=="2"){
                        var columnName = $(this).attr("data-columnName");
                        var mainKey = $(this).attr("data-column");
                        var mid = $(this).attr("data-mid");
                        $.wyui.postMethod("/logs/getTableLogsNum.json", {
                            "tableName":tableName,
                            "columnName":columnName,
                            "mainKey":mainKey,
                            "id":mid
                        }, function (data) {
                            console.log(data)
                            if (data.result) {
                                var p = new Array();
                                p.push("<i></i>");
                                demo.addClass("jiaobiao3");
                                if(that.showToday(data.updateTime)){
                                    demo.children("span").css("color","#ff0000");
                                }
                                demo.append(p.join(""))
                            }
                        })
                    }
                })
            },
        },
            mounted: function () {
            var that = this;
            if ($.wyui.page.urlParams.isAdd == 0) {
                $.wyui.postMethod('/deviceDisplace/getDisplaceById.json', {id: $.wyui.page.urlParams.id}, function (r) {
                    that.selectCom = r.displace.fkCompanyId;
                    /*获取审核历史记录*/
                    that.auditHistorys = r.auditHistory
                    /*查询库存地*/
                    $.wyui.postMethod('/company/getCompanyById.json', {id: r.displace.fkCompanyId}, function (r) {
                        that.stocks = r.stock;
                    })
                    /*查询区域*/
                    $.wyui.postMethod('/deviceDisplace/findRegionByCompanyId.json', {companyId: r.displace.fkCompanyId}, function (r) {
                        that.regions = r.regions;
                    })
                    /*查询大区经理*/
                    $.wyui.postMethod('/deviceDisplace/findBigRegionManagerByRegionId.json', {regionId: r.displace.regionId}, function (r) {
                        that.bigRegionManager = r.regions;
                    })
                    /*查询区域经理*/
                    $.wyui.postMethod('/deviceDisplace/findRegionManagerByBigRegionManagerId.json', {bigRegionId: r.displace.regionId}, function (r) {
                        that.regionManager = r.regions;
                    })
                    /*出库*/
                    if (r.outBoundRecord.flag == 1) {
                        that.outBound.main = r.outBoundRecord.main;
                        that.outType = that.outBound.main.type;
                        that.outBound.certificates = r.outCertificates;
                        that.outBound.devicePictures = r.outDevicePictures;
                        that.outBound.drayPictures = r.outDrayPictures;
                    } else {
                        that.outBound.main = "";
                        $("#outBound").hide();
                    }
                    /*移库*/
                    if (r.moveBoundRecord.flag == 1) {
                        that.moveBound.main = r.moveBoundRecord.main;
                        that.outType = that.moveBound.main.type;
                        that.moveBound.certificates = r.moveCertificates;
                        that.moveBound.devicePictures = r.moveDevicePictures;
                        that.moveBound.drayPictures = r.moveDrayPictures;
                    } else {
                        that.moveBound.main = "";
                        $("#moveBound").hide();
                    }
                    /*退货*/
                    if (r.returnBoundRecord.flag == 1) {
                        that.returnBound.main = r.returnBoundRecord.main;
                        that.outType = that.returnBound.main.type;
                        that.returnBound.certificates = r.returnCertificates;
                        that.returnBound.devicePictures = r.returnDevicePictures;
                        that.returnBound.drayPictures = r.returnDrayPictures;
                    } else {
                        that.returnBound.main = "";
                        $("#returnBound").hide();
                    }

                    var params = {moduleId: r.displace.id};
                    commonService.getAttachesByModuleId(params, function (attaches) {
                        if (attaches) {
                            r.displace.attaches = attaches;
                        }
                        that.displace = r.displace;
                });
                    if (r.changeTransport) {
                        that.transportChange = r.changeTransport;
                    };
                    if($.wyui.page.urlParams.pageType=='look'){
                        that.getMoreHistory();
                    }
                })
            }
            /*查询设备*/
            $.wyui.postMethod('/deviceSample/getDeviceTypeList.json', {}, function (r) {
                console.log(r);
                that.itemsType = r.records;
            })
            /*查询公司*/
            $.wyui.postMethod('/company/getCompanyListByUserId.json', {"userId": that.userId}, function (r) {
                console.log(r);
                if (r.records == "null") {
                    alert("未找到相关公司");
                } else {
                    that.itemsCom = r;
                    if('山西沃源,内蒙辽鞍'.indexOf(getCurrentUser().companyName)>-1){
                        that.itemsCom.push(
                            /*{"id":"201804031651473CA771C95F5B8A0ACF","name":"山西沃源"},
                            {"id":"2018041104174574AC1D4939178B2D27","name":"内蒙辽鞍"},*/
                            {"id":"wanliu","name":"湾流"},
                            {"id":"201712161613432EAF27DBCCB7D0E6CA","name":"滚滚向前集团"},
                            {"id":"2017121617464DFEB683A82815924552","name":"辽宁灜湖"},
                            {"id":"20171216174747FEAED47B7D5A930A0E","name":"江苏滚滚向前"},
                            {"id":"2017121617474A689E011EEA1635A09D","name":"河北灜源"},
                            {"id":"2017121617484353B8D81EEAFB4598A6","name":"湖南清源"},
                            {"id":"2017121617484B3A8193DB9B6CB372AC","name":"甘肃&宁夏"},
                            {"id":"2017121617484BB9BEB4A635E7458410","name":"安徽灜湖"},
                            {"id":"2017121910424ED9AA4F786D5549D72F","name":"江苏灜沣"},
                            {"id":"2018042608364206B46EC406F62EC079","name":"黑龙江灜源"},
                            {"id":"20180426083647FCBC7D08C7B14E496E","name":"吉林清源"},
                            {"id":"2019011814474FCDB1FC400060A3BEBF","name":"江苏沣澄"},
                            {"id":"","name":"其他"}
                        )
                    }
                }

            })
            if (that.pageType != "look") {
                //初始化上传控件
                $(".fj").each(function () {
                    var demo = $(this);
                    var name = demo.attr("id");
                    var nameValue = name + "Name";
                    console.log(that.displace)
                    console.log(that.transportChange)
                    var uploader = WebUploader.create({
                        // 选完文件后，是否自动上传。
                        auto: true,
                        // swf文件路径
                        swf: "/statics/plugin/webuploader-0.1.5/Uploader.swf",
                        // 文件接收服务端。
                        server: server.fjIp + "/attach/uploadFile.json",
                        // 选择文件的按钮。可选。
                        // 内部根据当前运行是创建，可能是input元素，也可能是flash.
                        pick: '#' + demo.attr("id"),
                        duplicate: true
                    });

                    // 文件上传过程中创建进度条实时显示。
                    uploader.on('uploadProgress', function (file, percentage) {
                        console.log(percentage)
                        var $li = $('#' + file.id),
                            $percent = $li.find('.progress span');
                        // 避免重复创建
                        if (!$percent.length) {
                            $percent = $('<p class="progress"><span></span></p>')
                                .appendTo($li)
                                .find('span');
                        }
                        $percent.css('width', percentage * 100 + '%');
                    });
                    uploader.on("uploadStart", function () {
                        $("#progress").show();
                    });
                    uploader.on("uploadComplete", function () {
                        $("#progress").hide();
                    });
                    // 文件上传成功，给item添加成功class, 用样式标记上传成功。
                    uploader.on('uploadSuccess', function (file, response) {
                        console.log(demo);
                        var nameValue = name + "Name";
                        var urlValue = name + "Url";
                        if (name == 'cmodelCarPhoto' || name == 'cdriverCertificate' || name == 'cdevicePhoto') {
                            console.log(response)
                            app.transportChange[nameValue] = response.name;
                            app.transportChange[urlValue] = response.url;
                            console.log(app.transportChange)
                        } else {
                            app.displace[nameValue] = response.name;
                            app.displace[urlValue] = response.url;
                            console.log(app.displace)
                        }
                        $("#" + name).hide();
                    });
                    // 文件上传失败，显示上传出错。
                    uploader.on('uploadError', function (file) {
                        alert("上传失败！");
                    });

                });
                that.uploadMore();//初始化添加附件控件
                that.uploadOutMore();//初始化添加附件控件
                that.uploadOutMore2();//初始化添加附件控件
            }
        }
    })
</script>
<script>
    $("#regionManager").autoComplete({
        url: server.ip + urlConfig.contract.getRegionManagerByUserId,
        render: function (users, panel) {
            for (var i = 0; i < users.length; i++) {
                $("<li></li>").data("autoComplete",
                    users[i]).html("<a>" + users[i].name + "&nbsp;&nbsp;&nbsp;" +
                    "(" + "&nbsp;" + users[i].companyName + "-" + users[i].departName + "-" + users[i].roleName + "&nbsp;" + ") " + "</a>")
                    .appendTo(panel);
            }
        },
        selected: function (user) {
            app.displace.regionManager = user.name;
            return false;
        },
        extraParams: {createUserId: getCurrentUser().id},
        height: 210,
        width: 420
    });
    $("#bigregionManager").autoComplete({
        url: server.ip + urlConfig.contract.getRegionManagerByUserId,
        render: function (users, panel) {
            for (var i = 0; i < users.length; i++) {
                $("<li></li>").data("autoComplete",
                    users[i]).html("<a>" + users[i].name + "&nbsp;&nbsp;&nbsp;" +
                    "(" + "&nbsp;" + users[i].companyName + "-" + users[i].departName + "-" + users[i].roleName + "&nbsp;" + ") " + "</a>")
                    .appendTo(panel);
            }
        },
        selected: function (user) {
            app.displace.bigregionManager = user.name;
            return false;
        },
        extraParams: {createUserId: getCurrentUser().id},
        height: 210,
        width: 420
    });
</script>
</html>